package models;

import org.junit.After;
import org.junit.Before;

import play.test.Fixtures;
import play.test.UnitTest;

/**
 * Base class for unit test in application. Generally does one thing - clear
 * Database before and after each Unit test. If you write test for model you
 * should extend this class.
 * 
 * @author koziolek
 * 
 */
public abstract class ReviewerModelTestPreparation extends UnitTest {

	/**
	 * Clear database before test. Theoretically database should be empty before
	 * each test because in {@link #tearDown()} method we clear them. However we
	 * clear database because we want to be sure that it is empty.
	 * 
	 * @throws Exception
	 */
	@Before
	public void setUp() throws Exception {
		Fixtures.deleteAll();
	}

	/**
	 * Clear database after each test.
	 * 
	 * @throws Exception
	 */
	@After
	public void tearDown() throws Exception {
		Fixtures.deleteAll();
	}

}